/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package SensorCheckersImpl;

import SensorCheckerInterface.ISensorChecker;
import CommonValue.Wind;
import DTO.SensorDTO;

/**
 *
 * @author Administrator
 */
public class WindSensorChecker extends BaseSensorChecker implements ISensorChecker{

    public WindSensorChecker() {
        setSensorCheckerSign(Wind.SIGN);
    }

    @Override
    public boolean CheckSensor(SensorDTO o) {
        System.out.println("Check : "+getSensorCheckerSign());
        if ((o.getData().get(Wind.SPEED)==null)||(o.getData().get(Wind.DIRECTION)==null)) return true;
        float speed = o.getData().get(Wind.SPEED);
        float direction = o.getData().get(Wind.DIRECTION);
        System.out.println(Wind.SPEED + " : " + speed);
        System.out.println(Wind.DIRECTION + " : "+ direction);        
        if (speed>Wind.SPEED_MAX) return false;
        return true;
    }
}